# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-beetle-pce-fast
pkgver=1231
pkgrel=1
pkgdesc='NEC PC Engine/CD core'
arch=(loong64 x86_64)
url=https://github.com/libretro/beetle-pce-fast-libretro
license=(GPL2)
groups=(libretro)
depends=(
  gcc-libs
  glibc
  libretro-core-info
  zlib
)
makedepends=(git)
_commit=1ce7a4a941b10aa0c2973cb441b89ee99e2c8d0e
source=(libretro-beetle-pce-fast::git+https://github.com/libretro/beetle-pce-fast-libretro.git#commit=${_commit})
sha256sums=(SKIP)

pkgver() {
  cd libretro-beetle-pce-fast

  git rev-list --count HEAD
}

build() {
  make \
    SYSTEM_LIBCHDR=0 \
    SYSTEM_ZLIB=1 \
    -C libretro-beetle-pce-fast
}

package() {
  install -Dm 644 libretro-beetle-pce-fast/mednafen_pce_fast_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
